import { createSerialDates } from "./tool"
import { DataSourceTypeEnum } from "@src/globalData/enum"

/**直接存数据组的数据格式转换方法 */
import { 
  marketDulDisclosureBackEndDul, 
  storageDataBackEndDul,
   twentyDourSwitchDot,
   beiYongDul,
   aheadOffonInfoDul,
   realtimeRegulatedInfoDul,
   realtimeNodePriceInfoDul,
   nodePriceAvg
  } from "./dulDataToDataSet"

// 获取 96 点数据
const getTimeArr96 = createSerialDates(['2020-01-01', '2020-01-01'],96,'HH:mm')
// 获取 24 点数据
const getTimeArr24 = createSerialDates(['2020-01-01', '2020-01-01'],24,'HH:mm')

// 获取 原始96 点数据
const getOriginTimeArr96 = createSerialDates(['2020-01-01', '2020-01-01'],96,'HH:mm',1)
// 获取 原始24 点数据
const getOriginTimeArr24 = createSerialDates(['2020-01-01', '2020-01-01'],24,'HH:mm',1)
console.log('调试',getOriginTimeArr96,getTimeArr96,getOriginTimeArr24,getTimeArr24)
/**根据数据类型调不同的配置去取数据传入到数据转换格式方法里面 */
export const methodConfig:any = {
  [DataSourceTypeEnum.AHEAD_MARKET_BEFORE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.AHEAD_MARKET_BEFORE_INFO,
    method:marketDulDisclosureBackEndDul
  },
  [DataSourceTypeEnum.REALTIME_MARKET_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.REALTIME_MARKET_INFO,
    method:marketDulDisclosureBackEndDul
  },
  [DataSourceTypeEnum.ACT_MARKET_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.ACT_MARKET_INFO,
    method:marketDulDisclosureBackEndDul
  },
  [DataSourceTypeEnum.AHEAD_PUMPED_BEFORE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.AHEAD_PUMPED_BEFORE_INFO,
    method:storageDataBackEndDul
  },
  [DataSourceTypeEnum.AHEAD_USER_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.AHEAD_USER_PRICE_INFO,
    nameToKey:"用户侧电价",
    method:twentyDourSwitchDot
  },
  [DataSourceTypeEnum.REALTIME_USER_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.REALTIME_USER_PRICE_INFO,
    nameToKey:"用户侧电价",
    method:twentyDourSwitchDot
  },
  [DataSourceTypeEnum.ACT_USER_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.ACT_USER_PRICE_INFO,
    nameToKey:"用户侧电价",
    method:twentyDourSwitchDot
  },
  [DataSourceTypeEnum.REALTIME_BACKUP_PREDICT_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.REALTIME_BACKUP_PREDICT_INFO,
    nameToKey:"ZBY",
    method:beiYongDul
  },
  [DataSourceTypeEnum.REALTIME_BACKUP_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.REALTIME_BACKUP_INFO,
    nameToKey:"FBY",
    method:beiYongDul
  },
  [DataSourceTypeEnum.ACT_BACKUP_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.ACT_BACKUP_INFO,
    nameToKey:"FBY",
    method:beiYongDul
  },
  [DataSourceTypeEnum.AHEAD_OFFON_INFO]:{
    timeArr:null,
    originTimeArr:null,
    type:DataSourceTypeEnum.AHEAD_OFFON_INFO,
    method:aheadOffonInfoDul
  },
  [DataSourceTypeEnum.AHEAD_REGULATED_INFO]:{
    timeArr:null,
    originTimeArr:null,
    type:DataSourceTypeEnum.AHEAD_REGULATED_INFO,
    method:realtimeRegulatedInfoDul
  },
  [DataSourceTypeEnum.REALTIME_NODE_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.REALTIME_NODE_PRICE_INFO,
    nameToKey:"节点电价",
    method:realtimeNodePriceInfoDul
  },
  [DataSourceTypeEnum.AHEAD_NODE_AVG_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.AHEAD_NODE_AVG_PRICE_INFO,
    method:nodePriceAvg
  },
  [DataSourceTypeEnum.ACT_NODE_AVG_PRICE_INFO]:{
    timeArr:getTimeArr96,
    originTimeArr:getOriginTimeArr96,
    type:DataSourceTypeEnum.ACT_NODE_AVG_PRICE_INFO,
    method:nodePriceAvg
  },
}